package org.lq.his.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.lq.his.dao.RoleDao;
import org.lq.his.pojo.Role;
import org.lq.his.service.RoleService;
import org.springframework.stereotype.Service;

@Service("roleService")
public class RoleServiceImpl implements RoleService {

	@Resource
	private RoleDao roleDao;
	
	public void setRoleDao(RoleDao roleDao) {
		this.roleDao = roleDao;
	}


	@Override
	public List<Role> getListByCondition(int start, int limit, Role condition, String column, String orderBy) {
		
		return roleDao.getListByCondition(start, limit, condition, column, orderBy);
	}


	@Override
	public int getCountByCondition(Role condition) {
		return roleDao.getCountByCondition(condition);
	}


	@Override
	public void addRole(Role role) {
		roleDao.add(role);
	}


	@Override
	public void deleteRole(Integer[] roleIds) {
		roleDao.deleteByIds(roleIds);
	}


	@Override
	public Role getRoleById(Integer id) {
		return roleDao.getById(id);
	}


	@Override
	public void editRole(Role role) {
		 roleDao.update(role);
	}


	@Override
	public List<Role> getAll() {
		return roleDao.getAll();
	}

}
